package com.acme.bankapp.service.command;

import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.bank.Client;
import com.acme.bankapp.exception.bank.ClientExistsException;
import com.acme.bankapp.exception.bank.FeedFormatException;
import com.acme.bankapp.exception.command.CommandException;
import com.acme.bankapp.service.bank.BankFeeder;

import java.util.Arrays;
import java.util.Collections;

/**
 * @author Gregory Sobko
 */
public class ListClientsCommand implements Command {

    private Bank bank;

    public ListClientsCommand(Bank bank) {
        this.bank = bank;
    }

    @Override
    public String getCommandPrefix() {
        return "list";
    }

    @Override
    public String executeCommand(String feedString){
        return Arrays.toString(bank.getAllClients().toArray());
    }

}
